package principles.demo3.after;

import principles.demo3.after.cpu.Cpu;
import principles.demo3.after.disk.Disk;
import principles.demo3.after.memory.Memory;

/**
 * @description: 电脑类
 **/

public class Computer {

    private Disk disk;
    private Cpu cpu;

    private Memory memory;


    public void run() {
        System.out.println("运行计算机");
        String data = disk.get();
        System.out.println("从银盘获取的数据是 =" + data);

        cpu.run();

        memory.save();
    }

    public Disk getDisk() {
        return disk;
    }

    public void setDisk(Disk disk) {
        this.disk = disk;
    }

    public Cpu getCpu() {
        return cpu;
    }

    public void setCpu(Cpu cpu) {
        this.cpu = cpu;
    }

    public Memory getMemory() {
        return memory;
    }

    public void setMemory(Memory memory) {
        this.memory = memory;
    }
}
